//
//  LDSSliderCollectionViewModel.m
//  TestCategory
//
//  Created by kai_leedarson on 2017/11/6.
//  Copyright © 2017年 maple_leedarson. All rights reserved.
//

#import "LDSSliderCollectionViewModel.h"
#import "UIResponder+Router.h"
@interface LDSSliderCollectionViewModel ()
{
    int curtIndex;
    BOOL isClick;
}
@end

@implementation LDSSliderCollectionViewModel

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
//    if (self.swipeDelegate != nil && [self.swipeDelegate respondsToSelector:@selector(contentSelectedIndexChanged:)])
//    {
//        int index = scrollView.contentOffset.y / scrollView.frame.size.width;
//        [self.swipeDelegate contentSelectedIndexChanged:index];
//    }
//    if (isClick) {
//        isClick = NO;
//    }
    [scrollView routerEventWithName:@"scrollEnd" userInfo:@{@"scrollView":scrollView}];
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    
//    if (!isClick) {
//        CGPoint pt = scrollView.contentOffset;
//        [self.swipeDelegate scrollOffsetChanged:pt];
//    }
}

//-(void)selectIndex:(int)index
//{
//    isClick = YES;
//    [_tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
//
//}
@end
